Skip to content

[build] Remove omnisharp.json generation from xaprepare#11631

Open
jonathanpeppers wants to merge 2 commits into
mainfrom
jonathanpeppers/remove-omnisharp-json-gen
Open

[build] Remove omnisharp.json generation from xaprepare#11631
jonathanpeppers wants to merge 2 commits into
mainfrom
jonathanpeppers/remove-omnisharp-json-gen

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Context

Get_Omnisharp_Json in Step_GenerateFiles substituted two placeholders into build-tools/scripts/omnisharp.json.in and wrote omnisharp.json at the repo root for OmniSharp / VS Code C# extension users. The generated file was always .gitignored and nothing in the repo, build, or CI consumes it — it was purely a local-dev convenience.

Anyone who actually wants an omnisharp.json can keep their own local copy (it remains gitignored). Removing this generation slice is another small step in the slow xaprepare reduction, continuing the pattern from #11568, #11580, #11608, and #11613.

Audit

Before this change git grep -in "omnisharp" returned five hits. After it returns only one — the unrelated MSBuild-context guard in xaprepare.csproj that prevents xaprepare's targets from importing under OmniSharp's MSBuild process:

build-tools/xaprepare/xaprepare/xaprepare.csproj:52:
  <Import Project="xaprepare.targets" Condition=" $(MSBuildToolsPath.IndexOf('omnisharp')) < 0 " />

That guard is intentional and is not touched by this PR.

Changes

  • build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs: drop the Get_Omnisharp_Json (context) entry from the generated-files list and delete the Get_Omnisharp_Json method.
  • Delete build-tools/scripts/omnisharp.json.in.
  • Remove /omnisharp.json from .gitignore — the file is no longer produced.

The shared properties used by the deleted method (MicrosoftDotnetSdkInternalPackageVersion, DotNetPreviewPath) are still referenced by Step_InstallDotNetPreview and xaprepare.targets, so they remain.

Verification

  • dotnet build build-tools/xaprepare/xaprepare/xaprepare.csproj -c Debug — 0 warnings, 0 errors.
  • git grep -in "omnisharp" — returns only the unrelated xaprepare.csproj guard described above.
  • No Documentation/ references to omnisharp; no .vscode/ folder in the repo.
  • Diff: 3 files, 35 deletions, 0 additions.

The Get_Omnisharp_Json step in Step_GenerateFiles substituted two
placeholders into build-tools/scripts/omnisharp.json.in and wrote an
omnisharp.json file at the repo root for OmniSharp / VS Code C# extension
users. The generated file was always .gitignored and nothing in the repo,
build, or CI consumes it -- it was purely a local-dev convenience.

Anyone who actually wants an omnisharp.json can keep their own local copy
(it remains gitignored). Removing the generation slice is another small
step in the slow xaprepare reduction, following the same pattern as
PRs #11568, #11580, #11608, and #11613.

Audit before / after: ``git grep -in omnisharp`` previously returned five
hits and now returns only one -- the unrelated MSBuild context guard in
xaprepare.csproj that prevents xaprepare''s targets from importing under
OmniSharp''s MSBuild process. That guard is intentional and is left
untouched.

Changes:
- Step_GenerateFiles.cs: drop the Get_Omnisharp_Json (context) entry from
  the generated-files list and delete the Get_Omnisharp_Json method.
- Delete build-tools/scripts/omnisharp.json.in.
- Remove /omnisharp.json from .gitignore (the file is no longer produced).

The shared properties used by the deleted method
(MicrosoftDotnetSdkInternalPackageVersion, DotNetPreviewPath) are still
referenced by Step_InstallDotNetPreview and xaprepare.targets, so they
remain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes local-developer-only omnisharp.json generation from xaprepare, continuing the ongoing reduction of xaprepare responsibilities in the build tooling.

Changes:

  • Removed Get_Omnisharp_Json from Step_GenerateFiles and deleted its implementation.
  • Deleted the build-tools/scripts/omnisharp.json.in template.
  • Updated .gitignore to stop ignoring /omnisharp.json.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs Removes the omnisharp-generated-file entry and its generator method.
build-tools/scripts/omnisharp.json.in Deletes the unused OmniSharp configuration template.
.gitignore Removes the repo-root omnisharp.json ignore entry.

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jun 11, 2026
Comment thread .gitignore
Novell
*.patch
*.keystore
/omnisharp.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone who actually wants an omnisharp.json can keep their own local copy (it remains gitignored).

I suggest keeping this file in .gitignore so we don't accidentally commit it if VS Code or something generates it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI says:

omnisharp.json is not generated automatically by the standard .NET SDK or OmniSharp tooling. If a repo needs OmniSharp-specific settings, the file is usually created manually at the workspace/repo root, or configured globally under the user’s OmniSharp config folder. For formatting/analyzer settings, .editorconfig is generally the better repo-wide option unless there’s a specific OmniSharp setting needed.

So, we must have written code to generate it at some point.

Most people probably would just use C# DevKit now anyway, but I guess they could get annoyed if it showed up as changes.

Keep the gitignore entry so contributors can drop their own local
omnisharp.json without it showing up in `git status`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants